I need something to do where I stored bmp images for alphabets and numbers and i call call those images when i type it in a textbox.
I have a sample code like
Public Class Form1
Dim graph As Graphics
Dim g, g1 As System.Drawing.Graphics
Dim img As New Bitmap(144, 16)
Dim brush As New Drawing.SolidBrush(Color.Black)
Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.TextChanged
g1 = Graphics.FromImage(img)
PictureBox1.Image = img
' to clear the bitmap
g1.Clear(Color.White)
'for drawsting function
g1.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
g1.TextRenderingHint = Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit
g1.CompositingQuality = Drawing2D.CompositingQuality.HighQuality
'to draw string
g1.DrawString(TextBox1.Text, TextBox1.Font, Brushes.Black, 0, 0)
PictureBox1.SizeMode = PictureBoxSizeMode.Normal
PictureBox1.Refresh()
End Sub
End Class
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Dim file As String = String.Format("{0}\{1}.bmp", Application.StartupPath, e.KeyChar.ToString)
If System.IO.File.Exists(file) Then
PictureBox1.ImageLocation = file
Else
PictureBox1.ImageLocation = String.Empty
End If
End Sub
and aslo i could not call more than one bmp image in mypicturebox..
can any one help me..
Madhu Mitha
25-Apr-2015Sunil Singh
25-Apr-2015Madhu Mitha
25-Apr-2015Sunil Singh
25-Apr-2015Madhu Mitha
25-Apr-2015Jack C
25-Apr-2015Madhu Mitha
25-Apr-2015Jack C
25-Apr-2015Madhu Mitha
25-Apr-2015Madhu Mitha
25-Apr-2015Sunil Singh
25-Apr-2015and also you can only able to set one image in picture box at a time
John Smith
25-Apr-2015